
/**
** \file       exec_while.c
**
** \brief      this function execute while rule
**
** \author     Ben M'rad Hanna, Laterem Hamza, Boillot Ulysse, De Olivera
**             Guillaume and Nguyen Viet Dung
**
** \version    0.8
**
** \date       23 November 2010
**
*/

#include "execution.h"

int     exec_while(s_rulewhile  *node)
{
  int   i = 0;

  while (exec_cmpdlist(node->in_while) == 0)
  {
    if (exec_dogroup(node->in_do) != 0)
      return (1);

    ++i;
  }

  if (i == 0)
    return (1);

  return (0);
}
